#ifndef FUNCTIONSLISTOLD_HPP_
#define FUNCTIONSLISTOLD_HPP_

#define Max_Variables  5
#include <string>

template<class myType>
myType GetMax(myType a, myType b) {
	return (a > b ? a : b);
}

template<class myType>
myType GetMin(myType a, myType b) {
	return (a < b ? a : b);
}
//---------------------------------------------------------------------------
//allocate a 2D array
template<class T> T** Allocate2D(int rows, int cols);
template<class T> T*** Allocate3D(int l, int m, int n);
//deallocate a 3D array
template<class T>
void Deallocate3D(T ***arr3D, int l, int m);

template<class T>
void Deallocate2D(T** arr2D, int rows);

template<class T> void
solve_linear_eqn(T **A, T *B, int n, T *XX);

//convert array into string, return the length of string.
template<class T> std::string ToString3D(T ***array, const int& w, const int& h, const int& d, bool with_index=false);
template<class T> std::string ToString2D(T **array, const int& w, const int& h, bool with_index=false);
int WriteFile(const char* file_name, const char* str, const int& length);
template<class T> int WriteArray3D(const char* file_name, T*** array, const int& w, const int& h, const int& d, bool with_index=false);
template<class T> int WriteArray2D(const char* file_name, T** array, const int& w, const int& h, bool with_index=false);

#endif
